package com.vchangyi.springboot.common.utils;

import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;

public class KeyGeneratorUtil {

    private static final String ALGORITHM = "AES";
    private static final String FIXED_KEY_STRING = "1234567890123456"; // 16字节的固定密钥
    private static final SecretKeySpec SECRET_KEY_SPEC;

    static {
        byte[] keyBytes = FIXED_KEY_STRING.getBytes();
        SECRET_KEY_SPEC = new SecretKeySpec(keyBytes, ALGORITHM);
    }

    public static SecretKeySpec getSecretKeySpec() {
        return SECRET_KEY_SPEC;
    }
}